//
//  UIViewController+Debugging.m
//  分享demo
//
//  Created by pc-chtypd056 on 2018/8/14.
//  Copyright © 2018年 CTL. All rights reserved.
//

#import "UIViewController+Debugging.h"

@implementation UIViewController (Debugging)

- (void)toggleDebugger
{
#ifdef DEBUG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
    id debugClass = NSClassFromString(@"UIDebuggingInformationOverlay");
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        [debugClass performSelector:NSSelectorFromString(@"prepareDebuggingOverlay")];
    });
    
    id debugOverlayInstance = [debugClass performSelector:NSSelectorFromString(@"overlay")];
    [debugOverlayInstance performSelector:NSSelectorFromString(@"toggleVisibility")];
#pragma clang diagnostic pop
#endif
}

@end
